package com.inspection.controller;

import com.alibaba.fastjson.JSONObject;
import com.inspection.service.InspectionUserService;
import com.inspection.support.Wrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhaoqi
 * @since 2020-11-05
 */
@RestController
public class TestJson {

    @Autowired
    private InspectionUserService inspectionUserService;

    @RequestMapping("/test")
    public Wrapper<String> test() {
        return Wrapper.ok("ok");
    }

    @RequestMapping("/user")
    public String getSpotCheck(Long id) {
        return JSONObject.toJSONString(inspectionUserService.getUser(id));
    }

}
